public class Test04 {
    public static void main(String[] args){
        //数组的拷贝
        int [] array = {1,2,3,4,5};
        int [] array1 = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            array1[i] = array[i];
            System.out.print(array1[i]+" ");
        }
        System.out.println();

        //数组的扩容
        int [] array2 = new int[array.length+1];
        for (int i = 0; i < array.length; i++) {
            array2[i] = 2*array[i];
            System.out.print(array2[i]+" ");
        }

    }
}
